const express = require('express')
const pool = require('../pool')
const router = express.Router()

//该接口用于 查询旅游攻略
//请求地址： http://127.0.0.1:3000/h2/tourism/strategy
//参数  不携带参数
router.get('/strategy',(req,res,next) => {
    pool.query('select * from tourism', (err,success) => {
        if(err) return next(err)
        if (success.length > 0) {
            res.send({ code: 200, msg: '查询到数据', data: success })
        } else {
            res.send({ code: 0, data: [], msg: '未查询到数据' })
        }
    })
})



module.exports = router